import axios from "axios";
// 进度条
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
// 创建实例
const instance = axios.create({
    // 配置url
    baseURL:'http://localhost:3001',
    method:'get',
    timeout:3000
})
// 拦截器
instance.interceptors.request.use(config=>{
    NProgress.start()
    return config
})

instance.interceptors.response.use(response=>{
    NProgress.done()
    return response
})

export default instance